<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Object.keys() Object.values() Object.entries()</title>
  </head>
  <body>
    <p>Object.keys(obj) 遍历对象自身非继承属性键名</p>
    <p>Object.values(obj) 遍历对象自身非继承属性键值</p>
    <p>Object.entries(obj) 遍历对象自身非继承属性键值对</p>
    <pre>
          let obj = { foo: "bar", baz: 42 };
          Object.keys(obj); // ['foo','baz']
          Object.values(obj); // ['bar',42]
          Object.entries(obj); // [['foo':'bar'],['baz':42]]
     </pre
    >
  </body>
</html>
<script>
  let obj = { foo: "bar", baz: 42 };
  console.log(Object.keys(obj)); // ['foo','baz']
  console.log(Object.values(obj)); // ['bar',42]
  console.log(Object.entries(obj)); // [['foo':'bar'],['baz':42]]
</script>
